import store from '@/store'
export const imgerror = {

  inserted: function(el, options) {
    el.onerror = () => {
      // 图片加载失败给一个默认图片地址
      el.src = options.value
    }
  }
}
export const allow = {
  inserted: function(el, options) {
    const points = store.state.user.userInfo.roles.points
    if (!points.includes(options.value)) {
      el.style.display = 'none'
    }
  }
}
export const focus = {
  inserted: function(el, options) {
    el.focus()
  }
}
